package com.zheng.作业.mode1Test;

import com.zheng.作业.mode1.Man;
import com.zheng.作业.mode1.Man15;
import com.zheng.作业.mode1.Person15;
import com.zheng.作业.mode1.Woman15;

public class Test15 {
    public static void main(String[] args) {
        Man15 m=new Man15();
        Woman15 w=new Woman15();
        meeting(m);
        meeting(w);

    }
    public static void meeting(Person15 p){
        p.eat();
        p.toilet();
        if (p instanceof Man15){
            Man15 man15=(Man15) p;
            man15.smoke();
        }else if (p instanceof Woman15){
            Woman15 woman15=(Woman15) p;
            ((Woman15) p).makeup();
        }
    }
}
